package com.atguigu.day09.test.ts05.ts01;

public class Animal {
    String name;
    int age;
    double height = 1.9;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Animal() {
    }

    @Override
    public String toString() {
        return "姓名:" + name + ",年龄:" + age;
    }
}

class Dog extends Animal {
    String color;
    double height = 1.6;

    public void showInfo() {
        //this:d1
        // System.out.println("名字:"+this.name+",年龄:"+super.age+" , "+this.age);
        System.out.println("this.height = " + this.height);
        System.out.println("super.height = " + super.height);
    }

    public Dog(String name, int age, String color) {
        super(name, age);
        this.color = color;
    }

    @Override
    public String toString() {
        return super.toString() + ",颜色:" + color;
    }
}
